const MyPromise = require('./MyPromise_6');
function p1 () {
    return new MyPromise(function (resolve, reject) {
        setTimeout(() => {resolve('p1 success')}, 1000)
    });
}
function p2() {
    return new MyPromise((resolve, reject) => {
        reject('p2 fail')
        // resolve('p2 success')
    })
}




p2().then(v => {
    console.log("resolve", v);
    return p1();
}).catch(e => {
    console.log(e);
})

